import request from "@/utils/request"
// 获取table数据展示
export const reqSpuList = (page, limit, category3Id) => request({ url: `/admin/product/${page}/${limit}`, method: "get", params: { category3Id: category3Id } })

// spuform
// 获取某个spu的全部信息
export const reqSpuInfo = (spuId) => request({ url: `/admin/product/getSpuById/${spuId}`, method: 'get' })
// 获得品牌数据
export const reqGetBrand = () => request({ url: "/admin/product/baseTrademark/getTrademarkList", method: "get" })
// 获取spuform图标
export const reqSpuImg = (spuId) => request({ url: `/admin/product/spuImageList/${spuId}`, method: "get" })
// 获取spuform平台全部销售属性
export const reqBaseSaleAttr = () => request({ url: "/admin/product/baseSaleAttrList", method: "get" })
// spuform修改添加的保存api
export const reqAddUpdateSave = (data) => {
    if (data.id) {
        // update
        return request({ url: "/admin/product/updateSpuInfo", method: "post", data })
    } else {
        return request({ url: "/admin/product/saveSpuInfo", method: "post", data })
    }
}


// skuform
// 图片展示列表
export const reqImageList = (spuId) => request({ url: `/admin/product/spuImageList/${spuId}`, method: "get" })
// 平台属性
export const reqAttrInfoList = (category1Id, category2Id, category3Id) => request({ url: `/admin/product/attrInfoList/${category1Id}/${category2Id}/${category3Id}`, method: "get" })
// 销售属性
export const reqSaleAttrList = (spuId) => request({ url: `/admin/product/spuSaleAttrList/${spuId}`, method: "get" })
// 删除spu
export const reqDeleteSpu = (spuId) => request({ url: `/admin/product/deleteSpu/${spuId}`, method: "delete" })
// SKUform保存
export const reqSaveSku = (skuInfo) => request({ url: `/admin/product/saveSkuInfo`, data: skuInfo, method: "post" })

// 获取sku列表展示数据
export const reqShowSkuList = (spuId) => request({ url: `/admin/product/findBySpuId/${spuId}`, method: "get" })







